package com.ruoyi.zhmk.domain;

import java.util.List;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excels;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.annotation.Excel.ColumnType;
import com.ruoyi.common.annotation.Excel.Type;
import com.ruoyi.common.annotation.Excels;
import com.ruoyi.common.core.domain.BaseEntity;

import javax.validation.constraints.Size;

/**
 * 人员信息对象 zhmk_user
 * 
 * @author sxl
 * @date 2021-06-10
 */
public class ZhmkUser extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 人员ID */
    @Excel(name = "用户序号", cellType = Excel.ColumnType.NUMERIC, prompt = "用户编号")
    private Long userId;

    /** 部门ID */
    @Excel(name = "部门编号", type = Excel.Type.IMPORT)
    private Long deptId;

    /** 部门父ID */
    private Long parentId;

    /** 姓名 */
    @Excel(name = "姓名")
    private String userName;

    /** 人员类型（00常驻人员 01临时人员） */
    @Excel(name = "人员类型", readConverterExp = "00=常驻人员,01=临时人员")
    private String userType;

    /** 联系电话 */
    @Excel(name = "联系电话")
    private String phonenumber;

    /** 性别（0男 1女 2未知） */
    @Excel(name = "性别", readConverterExp = "0=男,1=女,2=未知")
    private String sex;

    /** 年龄 */
    @Excel(name = "年龄")
    private Long age;

    /** 头像路径 */
    @Excel(name = "头像路径")
    private String avatar;

    /** 人员状态（0在位人员 1请假人员 2集训人员 3公干人员 4其他） */
    @Excel(name = "人员状态", readConverterExp = "0=在位人员,1=请假人员,2=集训人员,3=公干人员,4=其他")
    private String userStatus;

    /** 删除标志（0代表存在 2代表删除） */
    private String delFlag;

    /** 临时人员最后使用时间 */
    /*@JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "临时人员最后使用时间", width = 30, dateFormat = "yyyy-MM-dd")*/
    private Date pwdUpdateDate;

    /** 部门对象 */
    @Excels({
        @Excel(name = "部门名称", targetAttr = "deptName", type = Excel.Type.EXPORT),
        @Excel(name = "部门负责人", targetAttr = "leader", type = Excel.Type.EXPORT)
    })

    private ZhmkDept zhmkDept;

    /** 岗位组 */
    private Long[] postIds;

    public ZhmkUser()
    {

    }

    public ZhmkUser(Long userId)
    {
        this.userId = userId;
    }

    public void setUserId(Long userId) 
    {
        this.userId = userId;
    }

    public Long getUserId() 
    {
        return userId;
    }

    public void setDeptId(Long deptId) 
    {
        this.deptId = deptId;
    }

    public Long getDeptId() 
    {
        return deptId;
    }

    public Long getParentId()
    {
        return parentId;
    }

    public void setParentId(Long parentId)
    {
        this.parentId = parentId;
    }

    public void setUserName(String userName) 
    {
        this.userName = userName;
    }

    @Size(min = 0, max = 30, message = "用户昵称长度不能超过30个字符")
    public String getUserName() 
    {
        return userName;
    }

    public void setUserType(String userType) 
    {
        this.userType = userType;
    }

    public String getUserType() 
    {
        return userType;
    }

    public void setPhonenumber(String phonenumber) 
    {
        this.phonenumber = phonenumber;
    }

    @Size(min = 0, max = 11, message = "手机号码长度不能超过11个字符")
    public String getPhonenumber() 
    {
        return phonenumber;
    }

    public void setSex(String sex) 
    {
        this.sex = sex;
    }

    public String getSex() 
    {
        return sex;
    }

    public void setAge(Long age) 
    {
        this.age = age;
    }

    public Long getAge() 
    {
        return age;
    }

    public void setAvatar(String avatar) 
    {
        this.avatar = avatar;
    }

    public String getAvatar() 
    {
        return avatar;
    }

    public void setUserStatus(String userStatus) 
    {
        this.userStatus = userStatus;
    }

    public String getUserStatus() 
    {
        return userStatus;
    }

    public void setDelFlag(String delFlag) 
    {
        this.delFlag = delFlag;
    }

    public String getDelFlag() 
    {
        return delFlag;
    }

    public void setPwdUpdateDate(Date pwdUpdateDate) 
    {
        this.pwdUpdateDate = pwdUpdateDate;
    }

    public Date getPwdUpdateDate() 
    {
        return pwdUpdateDate;
    }

    public ZhmkDept getDept()
    {
        if (zhmkDept == null)
        {
            zhmkDept = new ZhmkDept();
        }
        return zhmkDept;
    }

    public void setDept(ZhmkDept zhmkDept)
    {
        this.zhmkDept = zhmkDept;
    }

    public Long[] getPostIds()
    {
        return postIds;
    }

    public void setPostIds(Long[] postIds)
    {
        this.postIds = postIds;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("userId", getUserId())
            .append("deptId", getDeptId())
            .append("userName", getUserName())
            .append("userType", getUserType())
            .append("phonenumber", getPhonenumber())
            .append("sex", getSex())
            .append("age", getAge())
            .append("avatar", getAvatar())
            .append("userStatus", getUserStatus())
            .append("delFlag", getDelFlag())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("remark", getRemark())
            .append("dept", getDept())
            .toString();
    }
}
